/*
 * IpcTranceiverFactory.cpp
 *
 *  Created on: Nov 2, 2013
 *      Author: vladimir
 */

#include "IpcTranceiverFactory.hpp"

#include "IpcMessageQueue.hpp"

namespace vjipc
{

namespace
{

IpcTranceiverFactory::IpcTranceiverPtr DefaultIpcTranceiverCreator( const std::string & name )
{
	IpcTranceiverFactory::IpcTranceiverPtr p( new IpcMessageQueue( name ) );

	return p;
}

IpcTranceiverFactory::CreatorFn creator = DefaultIpcTranceiverCreator;

}

IpcTranceiverFactory::IpcTranceiverPtr IpcTranceiverFactory::Create( const std::string & name )
{
	return creator( name );
}

void IpcTranceiverFactory::ResetCreator()
{
	creator = DefaultIpcTranceiverCreator;
}

void IpcTranceiverFactory::SetCreator( CreatorFn newCreator )
{
	creator = newCreator;
}

} /* namespace vjipc */
